<?php
/** @var RoleController $this */
/** @var Role $model */

$this->pageTitle = '角色';

$this->breadcrumbs = array(
	'用户' => array('user/index'),
	'角色',
);
?>

	<div class="page-header">
		<h1>角色 <?php echo CHtml::link('创建', array('create'), array('class' => 'btn btn-link')); ?></h1>
	</div>

<?php
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
	'action' => array('saveWeight'),
));
?>
<?php $this->widget('bootstrap.widgets.TbGridView', array(
	'id' => 'role-grid',
	'dataProvider' => $model->search(),
	'filter' => $model,
	'columns' => array(
		'name',
		'description',
		array(
			'class' => 'YInputColumn',
			'name' => 'weight',
			'primaryKey' => 'name',
			'inputHtmlOptions' => array('name' => 'weight')
		),
		array(
			'class' => 'bootstrap.widgets.TbButtonColumn',
			'deleteConfirmation' => '确定要删除这个角色吗？该操作不可逆转，请谨慎操作',
			'template' => '{update} {delete}',
		),
	),
)); ?>
	<div class="text-right">
		<?php $this->widget('bootstrap.widgets.TbButton', array(
			'buttonType' => 'submit',
			'htmlOptions' => array('name' => 'saveWeight'),
			'type' => 'secondary',
			'label' => '保存权重',
		));
		?>
	</div>
<?php $this->endWidget(); ?>